<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var findUnsortedSubarray = function (nums) {
        let targetArr = [];    //用来保存下标
        let newArr = nums.map(i => i); //复制数组
        nums.sort(function (a, b) { return a - b; }); //对原数组排序
        for (let i = 0; i < nums.length; i++) {
          if (newArr[i] === nums[i]) continue;
          targetArr.push(i);      //将需要调整位置的元素下标保存起来
        } 0
        if (targetArr.length === 0) return 0;
        console.log(targetArr)
        return targetArr[targetArr.length - 1] - targetArr[0] + 1;
      };
    console.log(findUnsortedSubarray([2, 6, 4, 8, 10, 9, 15]));
  </script>
</body>
</html>


  <template slot-scope="{index,row}">
    <el-button type="primary" size="mini" @click="openUpdate()">修改</el-button>
    <el-button size="mini" type="danger" @click="deleteGoods(row)">删除</el-button>
  </template>